<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Overlay</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.4.0pr3/build/cssgrids/grids-min.css">
    <link rel="stylesheet" href="../assets/css/main.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <script src="../../build/yui/yui-min.js"></script>
</head>
<body>

<div id="doc">
    <h1>Overlay</h1>

    
        <a href="#toc" class="jump">Jump to Table of Contents</a>
    

    <div class="yui3-g">
        <div id="main" class="yui3-u">
            <div class="content"><div class="intro">
    <p>Overlay is a positionable and stackable widget, which also provides support for the standard module format layout, with a header, body and footer section.

    <p>The overlay is built by extending the <a href="http://yuilibrary.com/yui/docs/api/Widget.html"><code>Widget</code></a> class and adding the <a href="http://yuilibrary.com/yui/docs/api/WidgetPosition.html"><code>WidgetPosition</code></a>, <a href="http://yuilibrary.com/yui/docs/api/WidgetStack.html"><code>WidgetStack</code></a>, <a href="http://yuilibrary.com/yui/docs/api/WidgetPositionAlign.html"><code>WidgetPositionAlign</code></a>, <a href="http://yuilibrary.com/yui/docs/api/WidgetPositionConstrain.html"><code>WidgetPositionConstrain</code></a> and <a href="http://yuilibrary.com/yui/docs/api/WidgetStdMod.html"><code>WidgetStdMod</code></a> extensions, 
    and doesn't actually need to add any implementation code of its own. The <a href="../widget/widget-build.html">"Creating Custom Widget Classes"</a> example shows how you can use these extensions to build classes which mix and match some of the above features.</p>
</div>

<h2 id="getting-started">Getting Started</h2>

<p>
To include the source files for Overlay and its dependencies, first load
the YUI seed file if you haven't already loaded it.
</p>

<pre class="code prettyprint">&lt;script src=&quot;http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.4.1&#x2F;build&#x2F;yui&#x2F;yui-min.js&quot;&gt;&lt;&#x2F;script&gt;</pre>


<p>
Next, create a new YUI instance for your application and populate it with the
modules you need by specifying them as arguments to the <code>YUI().use()</code> method.
YUI will automatically load any dependencies required by the modules you
specify.
</p>

<pre class="code prettyprint">&#x2F;&#x2F; Create a new YUI instance and populate it with the required modules.
YUI().use(&#x27;overlay&#x27;, function (Y) {
    &#x2F;&#x2F; Overlay is available and ready for use. Add implementation
    &#x2F;&#x2F; code here.
});</pre>


<p>
For more information on creating YUI instances and on the
<a href="http://yuilibrary.com/yui/docs/api/classes/YUI.html#method_use"><code>use()</code> method</a>, see the
documentation for the <a href="../yui/index.html">YUI Global object</a>.
</p>


<h2 id="using">Using Overlay</h2>

<h3 id="instantiating">Instantiating The Overlay</h3>

<p>The Overlay widget extends the <code>Widget</code> class, and hence the Overlay constructor follows the same pattern as any Widget constructor, accepting a configuration object to set the initial configuration for the widget.</p>

<h4 id="instantiating-from-markup-progressive-enhancement">Instantiating From Markup: Progressive Enhancement</h4>

<p>The overlay can be instantiated from markup, by specifying the <code>srcNode</code> which contains the header, body and footer content for the overlay:</p>

<pre class="code prettyprint">&lt;div id=&quot;myContent&quot;&gt;
    &lt;div class=&quot;yui3-widget-hd&quot;&gt;Overlay Header&lt;&#x2F;div&gt;
    &lt;div class=&quot;yui3-widget-bd&quot;&gt;Overlay Body&lt;&#x2F;div&gt;
    &lt;div class=&quot;yui3-widget-ft&quot;&gt;Overlay Footer&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;</pre>


<p>The header, body and footer sections provided in markup need to be marked with the class name which <code>Overlay</code> (or more accurately, <code>WidgetStdMod</code>) expects for the section ("yui3-widget-hd", "yui3-widget-bd" and "yui3-widget-ft") as shown above. 
All of these sections are optional. If content is set via the API at a later point the corresponding section will be created dynamically.</p>

<p>When instantiating from markup, a reference to the <code>srcNode</code> is provided in the configuration object. This reference can be a node reference, or a selector string which can be used to identify the node. If the selector string is too broad (returns multiple nodes), the first node found will be used.
The following code targets the markup shown above:</p>

<pre class="code prettyprint">YUI({...}).use(&quot;overlay&quot;, function(Y) {

    &#x2F;&#x2F;...
    var overlay = new Y.Overlay({
        &#x2F;&#x2F; Specify a reference to a node which already exists 
        &#x2F;&#x2F; on the page and contains header&#x2F;body&#x2F;footer content
        srcNode:&quot;#myContent&quot;,

        &#x2F;&#x2F; Also set some of the attributes inherited from
        &#x2F;&#x2F; the base Widget class.
        visible:false,
        width:&quot;20em&quot;
    });
    &#x2F;&#x2F;...

});</pre>


<p>Following instantiation, a call to <code>render</code> is required to have the Overlay's state reflected in the DOM, as with all YUI 3 widgets:</p>

<pre class="code prettyprint">var overlay = new Y.Overlay({ ... });
overlay.render();</pre>


<p>Note that you could set the state of the Overlay multiple times (modifying content, changing dimensions etc.) before rendering. 
When the <code>render</code> method is invoked, the state of the Overlay at that point in time will be reflected in the DOM.</p>

<p>When <code>render</code> is invoked, the overlay's content box will be wrapped by the bounding box (another DIV), to provide the <a href="../widget/index.html#markup">nested box structure</a> common to all widgets.</p>

<h4 id="instantiating-from-script">Instantiating From Script</h4>

<p>You can also create Overlay instances entirely from script, setting content programmatically, using the <code>headerContent</code>, <code>bodyContent</code> and <code>footerContent</code> attributes.</p>

<pre class="code prettyprint">var overlay = new Y.Overlay({
    headerContent:&quot;My Overlay Header&quot;,
    bodyContent:&quot;My Overlay Body&quot;,
    footerContent:&quot;My Footer Content&quot;,
    &#x2F;&#x2F;...
});
overlay.render(&quot;#parentNode&quot;);</pre>


<p>Content can be strings containing markup (innerHTML will be used to set the content), or <code>Node</code> references, in which case they will be appended to the section (header, body or footer) node.</p>

<p>The <code>render</code> method can be passed a node reference (or a selector string) as shown above, to specify the node
under which the overlay's bounding box should be added to the DOM. When rendering an overlay instance which has not been created from markup 
(so it does not have a position in the DOM) if this argument is not provided the overlay will be added to the document's body element (inserted as the first child to avoid the potential for "operation aborted" errors in IE6).
</p>

<h3 id="attributes">Attributes</h3>

<p>Overlay adds the following key attributes (through the extensions mentioned above), in addition to the attributes provided by the base <a href="../widget/index.html#attributes">Widget</a> class:</p>

<table>
    <tr><th>Attribute</th><th>Description</th></tr>
    <tr><td><code>x</code>, <code>y</code> and <code>xy</code></td><td>Positioning attributes, to set the XY position in page coordinates on the Overlay's bounding box. Set to [0,0] by default</td></tr>
    <tr><td><code>zIndex</code></td><td>Sets the z-index on the Overlay's bounding box. Set to 0 by default.</td></tr>
    <tr><td><code>shim</code></td><td>Boolean, indicating whether or not an iframe shim should be added to the Overlay to protect against select box bleed through. It is only enabled by default for IE6.</td></tr>
    <tr><td><code>align</code></td><td>Used to align a specific point on the Overlay's bounding box to a specific point on another node, or the viewport. Set to null by default.</td></tr>
    <tr><td><code>centered</code></td><td>Used to center the Overlay inside another node, or inside the viewport. Set to false by default.</td></tr>
    <tr><td><code>constrain</code></td><td>Used to specify a node to constrain the Overlay to, when setting the XY position. Can also be set to true, to constrain to the viewport. Set to false by default.</td></tr>
    <tr><td><code>headerContent</code></td><td>Used to set the content of the Overlay's header section. No default value set.</td></tr>
    <tr><td><code>bodyContent</code></td><td>Used to set the content of the Overlay's body section. No default value set.</td></tr>
    <tr><td><code>footerContent</code></td><td>Used to set the content of the Overlay's footer section. No default value set.</td></tr>
    <tr><td><code>fillHeight</code></td><td>Specifies which of the 3 sections - header, body or footer, should be automatically sized to fill out the height of the Overlay if a fixed height has been set. Set to WidgetStdMod.BODY by default. Can be disabled by setting to null.</td></tr>
</table>

<h3 id="positioning">Positioning</h3>

<h4 id="basic-xy-positioning">Basic XY Positioning</h4>

<p>Overlay provides basic XY positioning support through its <code>x</code>, <code>y</code> and <code>xy</code> attributes as well as a convenience <code>move</code> method which wraps the <code>xy</code> attribute.</p>

<p>The xy position of the overlay can be set in the constructor, as with any attribute value:</p>

<pre class="code prettyprint">var overlay = new Y.Overlay({
    srcNode:&quot;#myContent&quot;,
    xy: [200,100]
});
overlay.render();

&#x2F;&#x2F; or

var overlay = new Y.Overlay({
    srcNode:&quot;#myContent&quot;,
    x: 200,
    y: 100
});
overlay.render();

&#x2F;&#x2F; or

var overlay = new Y.Overlay({
    srcNode:&quot;#myContent&quot;,
    x: 200 &#x2F;&#x2F; y defaults to 0
});
overlay.render();</pre>


<p>The overlay's default position, if xy values are not provided, will be 0,0. Note that xy are page coordinates, not relative coordinates.</p>

<p>Changes in the overlay's position, when set programmatically through the API, can be monitored by listening for the attribute <code>xyChange</code> event. Listeners
to this event will receive an event facade, which contains previous and new xy values:</p>

<pre class="code prettyprint">&#x2F;&#x2F; Listen to the &quot;on&quot; moment, if you&#x27;re interested in
&#x2F;&#x2F; preventing the change in position from occurring.
overlay.on(&quot;xyChange&quot;, function(e) {

    var currPosition = e.prevVal;
    var newPosition = e.newVal;

    if (newPosition[0] &gt; MAX_X || newPosition[1] &gt; MAX_Y) {
        &#x2F;&#x2F; Stop move from occurring. 
        e.preventDefault();
    }
});

&#x2F;&#x2F; Listen to the &quot;after&quot; moment, if you&#x27;re just interested 
&#x2F;&#x2F; in being notified when the position has been changed.
overlay.after(&quot;xyChange&quot;, function(e) {
    var position = e.newVal;
    console.log(&quot;Overlay has been moved to: &quot; + position[0] + &quot;,&quot; position[1]);
});</pre>


<p>Note that changing just the <code>x</code> or <code>y</code> attribute value, individually, will still fire the <code>xy</code> change event. The <code>x</code> and 
<code>y</code> attribute values are simply convenience wrappers which end up setting the <code>xy</code> attribute.</p>

<p>XY position can also be set after construction, as with any attribute, using <code>set</code> to change the attribute value directly, or using the <code>move</code> method:</p>

<pre class="code prettyprint">overlay.set(&quot;x&quot;, 100);

overlay.set(&quot;y&quot;, 200);

overlay.set(&quot;xy&quot;, [100,200]);

overlay.move(100,200);

overlay.move([100,200]);</pre>


<p>The <a href="overlay-xy.html">Basic XY Positioning</a> example shows basic positioning in action.</p>

<h4 id="extended-xy-positioning">Extended XY Positioning</h4>

<p>Overlay also provides support to help position it relative to another node on the page, or the viewport, through the <code>align</code> and <code>centered</code> attributes, as well as 
the corresponding <code>align()</code> and <code>centered()</code> convenience methods, through the application of the <code>WidgetPositionAlign</code> extension.</p>

<p>The <code>align</code> attribute accepts as a value an object literal with the following properties:</p>
<dl>
    <dt>node</dt>
    <dd>
      The node to which the Widget is to be aligned. If set to null, or not provided, the Overlay is aligned to the viewport
    </dd>
    <dt>points</dt>
    <dd>
      <p>
      A two element array, defining the two points on the Overlay and node which are to be aligned. The first element is the point on the Overlay, and the second element is the point on the node (or viewport).
      Supported alignment points are defined as static properties on <a href="http://yuilibrary.com/yui/docs/api/WidgetPositionAlign.html#property_WidgetPositionAlign.TL"><code>WidgetPositionAlign</code></a>. For example:
      </p>
      <p>
      <code>[Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.TL]</code> aligns the Top-Right corner of the Overlay with the
      Top-Left corner of the node/viewport, and <code>[Y.WidgetPositionAlign.CC, Y.WidgetPositionAlign.TC]</code> aligns the Center of the 
      Overlay with the Top-Center edge of the node/viewport.
      </p>
    </dd>
</dl>

<pre class="code prettyprint">&#x2F;&#x2F; Align the:
&#x2F;&#x2F; top-left corner of the overlay, with the 
&#x2F;&#x2F; top-right corner of the node with id = &quot;okBtn&quot;
overlay.set(&quot;align&quot;, {
    node:&quot;#okBtn&quot;,
    points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]
});

&#x2F;&#x2F; Align the:
&#x2F;&#x2F; right-center edge of the overlay, with the 
&#x2F;&#x2F; right-center edge of the viewport (no node specified)
overlay.set(&quot;align&quot;, {
    points:[Y.WidgetPositionAlign.RC, Y.WidgetPositionAlign.RC]
});

&#x2F;&#x2F; Align the:
&#x2F;&#x2F; center of the overlay, with the 
&#x2F;&#x2F; top-left corner of the node with id = &quot;okBtn&quot;
overlay.align(&quot;#okBtn&quot;, [Y.WidgetPositionAlign.CC, Y.WidgetPositionAlign.TL]);</pre>


<p>The <code>centered</code> property can either by set to <code>true</code> to center the Overlay in the viewport, or set to a selector string or node reference to center the Overlay in a particular node.</p>

<pre class="code prettyprint">&#x2F;&#x2F; Center the overlay in the node with id = &quot;module&quot;
overlay.set(&quot;centered&quot;, &quot;#module&quot;);

&#x2F;&#x2F; Center the overlay in the viewport
overlay.set(&quot;centered&quot;, true);</pre>


<p>The <a href="overlay-align.html">"Alignment Support"</a> example shows aligned positioning support in action.</p>

<p>Note that currently alignment/centering is not maintained when the viewport is scrolled, window resized etc. Support to re-align the overlay on a default and custom set of trigger events will be 
provided in a future release.</p>

<p>In addition to being able to align the overlay to a given element (or the viewport), overlay also supports the ability to constrain its XY position to a given node, or to the viewport.</p>

<pre class="code prettyprint">&#x2F;&#x2F; Constrains the XY position to a given node:
overlay.set(&quot;constrain&quot;, &quot;#constrainingNode&quot;);

&#x2F;&#x2F; Or to the viewport
overlay.set(&quot;constrain&quot;, true);</pre>


<p>The <a href="overlay-constrain.html">"Constrain Support"</a> example shows constrained positioning in action.</p>

<h3 id="stacking">Stacking</h3>

<p>
The Overlay provides basic stacking support in the form of a <code>zIndex</code> attribute and a <code>shim</code> attribute. The shimming support protects against &lt;select&gt; box bleed through on 
IE6 (It is enabled by default for IE6) by adding an iframe shim to the overlay's bounding box (positioned underneath the content box). The default value of the <code>zIndex</code> attribute is 0.</p>

<p>Using the <code>zIndex</code> and <code>shim</code> attributes is the same as any other attribute, with the ability to set values in the constructor, or at a later point in time:</p>

<pre class="code prettyprint">&#x2F;&#x2F; Disable shim for all browsers, set zIndex to 10
var overlay = new Y.Overlay({
    shim:false, &#x2F;&#x2F; Disable for all browsers, including IE6
    zIndex:10
});

&#x2F;&#x2F; Set zIndex to 10. Shim is enabled for IE6 but disabled for all
&#x2F;&#x2F; other browsers (default value)
var overlay = new Y.Overlay({
    zIndex:10
});</pre>


<p>The <a href="overlay-stack.html">"Stack Support"</a> example creates a simple "bringToTop" implementation based on the <code>zIndex</code> attribute. 
This support will be provided as part of Overlay itself (or more precisely, as part of <code>WidgetStack</code>) in a future release.</p>

<h3 id="content">Setting Section Content</h3>

<p>Overlay uses the standard module format for its rendering. It provides a header, body and footer section as described above (through the <code>WidgetStdMod</code> extension).</p>

<h4 id="replacing-content">Replacing Content</h4>

<p>The content for each of these sections is settable either through the <code>headerContent</code>, <code>bodyContent</code> and <code>footerContent</code> attributes. Setting the content
through these properties will replace any existing content in the section. The content can either be specified as a string, in which case innerHTML will be used to set the new content, or 
specified as a <code>Node</code> instance, in which case the content will be added to the respective section using <code>appendChild</code> after clearing existing content.</p>

<pre class="code prettyprint">var overlay = new Y.Overlay({
    headerContent: &#x27;&lt;span class=&quot;title&quot;&gt;My Header Content&lt;&#x2F;span&gt;&#x27;,
    bodyContent: &#x27;&lt;div class=&quot;mod&quot;&gt;My Body Content&lt;&#x2F;div&gt;&#x27;
    &#x2F;&#x2F; Don&#x27;t want a footer
});

&#x2F;&#x2F; or 

overlay.set(&quot;headerContent&quot;, &#x27;&lt;span class=&quot;title&quot;&gt;My Header Content&lt;&#x2F;span&gt;&#x27;);

&#x2F;&#x2F; or 

var headerContent = Y.Node.create(&quot;&lt;span&gt;&lt;&#x2F;span&gt;&quot;);
headerContent.set(&quot;innerHTML&quot;, &quot;My Header Content&quot;);
headerContent.addClass(&quot;title&quot;); 

overlay.set(&quot;headerContent&quot;, headerContent);</pre>

            
<p>Overlay will not create the section if there has been no content set for it. (So, for example, the overlay above will not have a footer section). Also, if the section doesn't exist it will be created,
the first time content is set for it.</p>

<p>As with any attribute change, you can listen for (and prevent) changes in content by listening for the corresponding attribute change event:</p>

<pre class="code prettyprint">overlay.on(&quot;bodyContentChange&quot;, function(e) {
    if (someCondition) {
        &#x2F;&#x2F; Don&#x27;t allow body content to be updated
        e.preventDefault():
    }
});

overlay.after(&quot;bodyContentChange&quot;, function(e) {
    &#x2F;&#x2F; body section has been modified
});</pre>


<p>Setting content in any of the sections will fire Widget's <code>contentUpdate</code> event, which can be monitored if you want to be notified of changes to any section. However, this event is purely a catch-all notification
event. It cannot be prevented to stop the content change from occurring:</p>

<pre class="code prettyprint">overlay.after(&quot;contentUpdate&quot;, function(e) {
    &#x2F;&#x2F; Content has been updated in one of the standard module sections.
});</pre>


<h4 id="insertingappending-content">Inserting/Appending Content</h4>

<p>Setting content using the attributes mentioned above always results in content being replaced. If you need to insert content before, or append content after existing content in the section, you can use the <code>setStdModContent(section, content, where)</code> method Overlay provides:</p>

<pre class="code prettyprint">overlay.setStdModContent(
    Y.WidgetStdMod.HEADER,       &#x2F;&#x2F; Section
    &quot;New Content To Insert&quot;,   &#x2F;&#x2F; Content
    Y.WidgetStdMod.BEFORE        &#x2F;&#x2F; Where
);

overlay.setStdModContent(
    Y.WidgetStdMod.FOOTER,      &#x2F;&#x2F; Section
    &quot;New Content To Append&quot;,  &#x2F;&#x2F; Content
    Y.WidgetStdMod.AFTER        &#x2F;&#x2F; Where
);</pre>


<ul>
    <li>The <code>section</code> argument specifies which section is to be updated. The constants <code>WidgetStdMod.HEADER</code>, <code>WidgetStdMod.BODY</code> and <code>WidgetStdMod.FOOTER</code> define valid values.</li>
    <li>The <code>content</code> argument specifies the new content to be added which, as with the attributes, can be a string HTML value or a node reference.</li>
    <li>The <code>where</code> argument specifies whether the content should be added before, after, or replace existing content. The constants <code>WidgetStdMod.BEFORE</code>, <code>WidgetStdMod.AFTER</code> and <code>WidgetStdMod.REPLACE</code></p> define valid values.</li>
</ul>

<p><em>Note, the above <code>WidgetStdMod</code> constants define the set of valid values wherever the API expects a "section" or "where" argument.</em></p>

<p>The content change events mentioned above, will be fired when content is set through the <code>setStdModContent</code> method just as they would when setting the content using the attribute.</p>

<p>The <a href="overlay-stdmod.html">Standard Module</a> example provides a way to exercise the above content attributes and methods.</p>

<h3 id="markup">Markup Structure</h3>

<p>The final rendered Overlay has the markup structure shown below:</p>

<pre class="code prettyprint">&lt;div class=&quot;yui3-widget yui3-overlay yui3-widget-positioned yui3-widget-stacked&quot;&gt;
    &lt;!--Bounding Box--&gt;
    &lt;div class=&quot;yui3-overlay-content yui3-widget-stdmod&quot;&gt;
    &lt;!--Content Box--&gt;
        &lt;div class=&quot;yui3-widget-hd&quot;&gt;Overlay Header Content&lt;&#x2F;div&gt;
            &lt;!--Header Section--&gt;
        &lt;div class=&quot;yui3-widget-bd&quot;&gt;Overlay Body Content&lt;&#x2F;div&gt;
            &lt;!--Body Section--&gt;
        &lt;div class=&quot;yui3-widget-ft&quot;&gt;Overlay Footer Content&lt;&#x2F;div&gt;
            &lt;!--Footer Section--&gt;
    &lt;&#x2F;div&gt;

    &lt;iframe class=&quot;yui3-widget-shim&quot;&gt;&lt;&#x2F;iframe&gt;
        &lt;!-- Stacking shim, if enabled--&gt;

&lt;&#x2F;div&gt;</pre>


<p>The bounding box is absolutely positioned by default, and top/left positioning and z-index values are applied to it. The nested bounding box/content box structure is discussed in detail on the <a href="../widget/index.html#markup">Widget markup discussion</a>.</p>

<p>In addition to the default classes applied to the bounding box and content box for all widgets ("yui3-overlay", "yui3-overlay-content", "yui3-widget"), the <code>WidgetStdMod</code>, <code>WidgetPositioned</code> and <code>WidgetStack</code> extensions also mark the appropriate boxes with 
"yui3-widget-stdmod", "yui3-widget-positioned" and "yui3-widget-stacked" classes as shown above.</p>

<p>The iframe shim, added if <code>shim</code> is enabled, is added to the bounding box, as sibling to the content box and stacked underneath it (using a -ve z-index).</p>

<h3 id="css">CSS</h3>

<p>Overlay is a generic, foundation widget and doesn't ship with a default look/feel out of the box. Its Sam Skin (build/overlay/assets/skins/sam/overlay.css) implementation consists only of core functional rules, to control how it is positioned and how it is hidden:</p>

<pre class="code prettyprint">.yui3-overlay {
    position:absolute;
}

.yui3-overlay-hidden {
    visibility:hidden
}</pre>


<p>Since it includes the <code>WidgetStack</code> extension, the following functional CSS is also provided (through build/widget/assets/skins/sam/widget-stack.css) to handle the shim element,
(along with the Gecko/Mac scroll bar support CSS mentioned above)</p>

<pre class="code prettyprint">.yui3-widget-stacked .yui3-widget-shim {
    opacity: 0;
    filter: alpha(opacity=0);
    position: absolute;
    border: none;
    top: 0px;
    left: 0px;
    padding: 0;
    margin: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    &#x2F;* 
       We&#x27;ll be setting these programmatically for IE6, 
       to account for cases where height is not set 
    *&#x2F;
    _width: 0;
    _height: 0;
}</pre>

</div>
        </div>

        <div id="sidebar" class="yui3-u">
            
                <div id="toc" class="sidebox">
                    <div class="hd">
                        <h2 class="no-toc">Table of Contents</h2>
                    </div>

                    <div class="bd">
                        <ul class="toc">
<li>
<a href="#getting-started">Getting Started</a>
</li>
<li>
<a href="#using">Using Overlay</a>
<ul class="toc">
<li>
<a href="#instantiating">Instantiating The Overlay</a>
<ul class="toc">
<li>
<a href="#instantiating-from-markup-progressive-enhancement">Instantiating From Markup: Progressive Enhancement</a>
</li>
<li>
<a href="#instantiating-from-script">Instantiating From Script</a>
</li>
</ul>
</li>
<li>
<a href="#attributes">Attributes</a>
</li>
<li>
<a href="#positioning">Positioning</a>
<ul class="toc">
<li>
<a href="#basic-xy-positioning">Basic XY Positioning</a>
</li>
<li>
<a href="#extended-xy-positioning">Extended XY Positioning</a>
</li>
</ul>
</li>
<li>
<a href="#stacking">Stacking</a>
</li>
<li>
<a href="#content">Setting Section Content</a>
<ul class="toc">
<li>
<a href="#replacing-content">Replacing Content</a>
</li>
<li>
<a href="#insertingappending-content">Inserting/Appending Content</a>
</li>
</ul>
</li>
<li>
<a href="#markup">Markup Structure</a>
</li>
<li>
<a href="#css">CSS</a>
</li>
</ul>
</li>
</ul>
                    </div>
                </div>
            

            
                <div class="sidebox">
                    <div class="hd">
                        <h2 class="no-toc">Examples</h2>
                    </div>

                    <div class="bd">
                        <ul class="examples">
                            
                                
                                    <li data-description="Shows how to instantiate a basic Overlay instance, and use the Overlay&#x27;s basic XY positioning support.">
                                        <a href="overlay-xy.html">Basic XY Positioning</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Shows how to use the Overlay&#x27;s XY alignment support, to align the Overlay relative to another element, or to the viewport.">
                                        <a href="overlay-align.html">Alignment Support</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Shows how to use the Overlay&#x27;s zindex and shim support when positioning Overlays above other elements on the page.">
                                        <a href="overlay-stack.html">Stack Support</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Shows how to modify content in the Overlay&#x27;s header, body and footer sections.">
                                        <a href="overlay-stdmod.html">Standard Module Support</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Shows how to use Overlay&#x27;s constrainment support, to limit the XY value which can be set for an Overlay.">
                                        <a href="overlay-constrain.html">Constrain Support</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Shows how to create a simple plugin to retrieve content for the Overlay using the io utility.">
                                        <a href="overlay-io-plugin.html">IO Plugin</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Shows how to create a simple plugin to animate the Overlay&#x27;s movement and visibility.">
                                        <a href="overlay-anim-plugin.html">Animation Plugin</a>
                                    </li>
                                
                            
                                
                            
                                
                            
                        </ul>
                    </div>
                </div>
            

            
                <div class="sidebox">
                    <div class="hd">
                        <h2 class="no-toc">Examples That Use This Component</h2>
                    </div>

                    <div class="bd">
                        <ul class="examples">
                            
                                
                            
                                
                            
                                
                            
                                
                            
                                
                            
                                
                            
                                
                            
                                
                                    <li data-description="Creating an accessible menu button using the Focus Manager Node Plugin, Event&#x27;s delegation support and mouseenter event, along with the Overlay widget and Node&#x27;s support for the WAI-ARIA Roles and States.">
                                        <a href="../node-focusmanager/node-focusmanager-3.html">Accessible Menu Button</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Use StyleSheet to adjust the CSS rules applying a page theme from user input">
                                        <a href="../stylesheet/stylesheet-theme.html">Adjusting a Page Theme on the Fly</a>
                                    </li>
                                
                            
                        </ul>
                    </div>
                </div>
            
        </div>
    </div>
</div>

<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>

</body>
</html>
